async function y() {
  // throw new Error('2')
  const a = await new Promise((resolve, reject) => { reject(5) })
  console.log(a);
  return 1;
}
y().then(res => console.log(res)).catch(reason => { 
  console.log(reason)
});

function y2() {
  return new Promise((resolve, reject) => {
    reject(4)
    resolve(1);
  });
}
y2().then().catch(reason => console.log(reason))
